<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - ged.info - test/impl/test_tools.ipp</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../index.html">directory</a> - <a href="index.html">test/impl</a> - test_tools.ipp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>ged.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2009-06-09</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">233</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">7.3 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">17</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : //  (C) Copyright Gennadiy Rozental 2005-2008.
<span class="lineNum">       2 </span>                : //  Distributed under the Boost Software License, Version 1.0.
<span class="lineNum">       3 </span>                : //  (See accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       4 </span>                : //  http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       5 </span>                : 
<span class="lineNum">       6 </span>                : //  See http://www.boost.org/libs/test for the library home page.
<span class="lineNum">       7 </span>                : //
<span class="lineNum">       8 </span>                : //  File        : $RCSfile$
<span class="lineNum">       9 </span>                : //
<span class="lineNum">      10 </span>                : //  Version     : $Revision: 49312 $
<span class="lineNum">      11 </span>                : //
<span class="lineNum">      12 </span>                : //  Description : supplies offline implementation for the Test Tools
<span class="lineNum">      13 </span>                : // ***************************************************************************
<span class="lineNum">      14 </span>                : 
<span class="lineNum">      15 </span>                : #ifndef BOOST_TEST_TEST_TOOLS_IPP_012205GER
<span class="lineNum">      16 </span>                : #define BOOST_TEST_TEST_TOOLS_IPP_012205GER
<span class="lineNum">      17 </span>                : 
<span class="lineNum">      18 </span>                : // Boost.Test
<span class="lineNum">      19 </span>                : #include &lt;boost/test/test_tools.hpp&gt;
<span class="lineNum">      20 </span>                : #include &lt;boost/test/unit_test_log.hpp&gt;
<span class="lineNum">      21 </span>                : #include &lt;boost/test/output_test_stream.hpp&gt;
<span class="lineNum">      22 </span>                : #include &lt;boost/test/framework.hpp&gt;
<span class="lineNum">      23 </span>                : #include &lt;boost/test/execution_monitor.hpp&gt; // execution_aborted
<span class="lineNum">      24 </span>                : #include &lt;boost/test/unit_test_suite_impl.hpp&gt;
<span class="lineNum">      25 </span>                : 
<span class="lineNum">      26 </span>                : // Boost
<span class="lineNum">      27 </span>                : #include &lt;boost/config.hpp&gt;
<span class="lineNum">      28 </span>                : 
<span class="lineNum">      29 </span>                : // STL
<span class="lineNum">      30 </span>                : #include &lt;fstream&gt;
<span class="lineNum">      31 </span>                : #include &lt;string&gt;
<span class="lineNum">      32 </span>                : #include &lt;cstring&gt;
<span class="lineNum">      33 </span>                : #include &lt;cctype&gt;
<span class="lineNum">      34 </span>                : #include &lt;cwchar&gt;
<span class="lineNum">      35 </span>                : #include &lt;stdexcept&gt;
<span class="lineNum">      36 </span>                : #include &lt;ios&gt;
<span class="lineNum">      37 </span>                : 
<span class="lineNum">      38 </span>                : // !! should we use #include &lt;cstdarg&gt;
<span class="lineNum">      39 </span>                : #include &lt;stdarg.h&gt;
<span class="lineNum">      40 </span>                : 
<span class="lineNum">      41 </span>                : #include &lt;boost/test/detail/suppress_warnings.hpp&gt;
<span class="lineNum">      42 </span>                : 
<span class="lineNum">      43 </span>                : //____________________________________________________________________________//
<span class="lineNum">      44 </span>                : 
<span class="lineNum">      45 </span>                : # ifdef BOOST_NO_STDC_NAMESPACE
<span class="lineNum">      46 </span>                : namespace std { using ::strcmp; using ::strlen; using ::isprint; }
<span class="lineNum">      47 </span>                : #if !defined( BOOST_NO_CWCHAR )
<span class="lineNum">      48 </span>                : namespace std { using ::wcscmp; }
<span class="lineNum">      49 </span>                : #endif
<span class="lineNum">      50 </span>                : # endif
<span class="lineNum">      51 </span>                : 
<span class="lineNum">      52 </span>                : namespace boost {
<span class="lineNum">      53 </span>                : 
<span class="lineNum">      54 </span>                : namespace test_tools {
<span class="lineNum">      55 </span>                : 
<span class="lineNum">      56 </span>                : // ************************************************************************** //
<span class="lineNum">      57 </span>                : // **************                print_log_value               ************** //
<span class="lineNum">      58 </span>                : // ************************************************************************** //
<span class="lineNum">      59 </span>                : 
<span class="lineNum">      60 </span>                : void
<span class="lineNum">      61 </span><span class="lineNoCov">              0 : print_log_value&lt;char&gt;::operator()( std::ostream&amp; ostr, char t )</span>
<span class="lineNum">      62 </span>                : {
<span class="lineNum">      63 </span><span class="lineNoCov">              0 :     if( (std::isprint)( (unsigned char)t ) )</span>
<span class="lineNum">      64 </span><span class="lineNoCov">              0 :         ostr &lt;&lt; '\'' &lt;&lt; t &lt;&lt; '\'';</span>
<span class="lineNum">      65 </span>                :     else
<span class="lineNum">      66 </span>                :         ostr &lt;&lt; std::hex
<span class="lineNum">      67 </span>                : #if BOOST_TEST_USE_STD_LOCALE
<span class="lineNum">      68 </span>                :         &lt;&lt; std::showbase
<span class="lineNum">      69 </span>                : #else
<span class="lineNum">      70 </span>                :         &lt;&lt; &quot;0x&quot;
<span class="lineNum">      71 </span>                : #endif
<span class="lineNum">      72 </span><span class="lineNoCov">              0 :         &lt;&lt; (int)t;</span>
<span class="lineNum">      73 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">      74 </span>                : 
<span class="lineNum">      75 </span>                : //____________________________________________________________________________//
<span class="lineNum">      76 </span>                : 
<span class="lineNum">      77 </span>                : void
<span class="lineNum">      78 </span><span class="lineNoCov">              0 : print_log_value&lt;unsigned char&gt;::operator()( std::ostream&amp; ostr, unsigned char t )</span>
<span class="lineNum">      79 </span>                : {
<span class="lineNum">      80 </span>                :     ostr &lt;&lt; std::hex
<span class="lineNum">      81 </span>                :         // showbase is only available for new style streams:
<span class="lineNum">      82 </span>                : #if BOOST_TEST_USE_STD_LOCALE
<span class="lineNum">      83 </span>                :         &lt;&lt; std::showbase
<span class="lineNum">      84 </span>                : #else
<span class="lineNum">      85 </span>                :         &lt;&lt; &quot;0x&quot;
<span class="lineNum">      86 </span>                : #endif
<span class="lineNum">      87 </span><span class="lineNoCov">              0 :         &lt;&lt; (int)t;</span>
<span class="lineNum">      88 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">      89 </span>                : 
<span class="lineNum">      90 </span>                : //____________________________________________________________________________//
<span class="lineNum">      91 </span>                : 
<span class="lineNum">      92 </span>                : void
<span class="lineNum">      93 </span><span class="lineNoCov">              0 : print_log_value&lt;char const*&gt;::operator()( std::ostream&amp; ostr, char const* t )</span>
<span class="lineNum">      94 </span>                : {
<span class="lineNum">      95 </span><span class="lineNoCov">              0 :     ostr &lt;&lt; ( t ? t : &quot;null string&quot; );</span>
<span class="lineNum">      96 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">      97 </span>                : 
<span class="lineNum">      98 </span>                : //____________________________________________________________________________//
<span class="lineNum">      99 </span>                : 
<span class="lineNum">     100 </span>                : void
<span class="lineNum">     101 </span><span class="lineNoCov">              0 : print_log_value&lt;wchar_t const*&gt;::operator()( std::ostream&amp; ostr, wchar_t const* t )</span>
<span class="lineNum">     102 </span>                : {
<span class="lineNum">     103 </span><span class="lineNoCov">              0 :     ostr &lt;&lt; ( t ? t : L&quot;null string&quot; );</span>
<span class="lineNum">     104 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     105 </span>                : 
<span class="lineNum">     106 </span>                : //____________________________________________________________________________//
<span class="lineNum">     107 </span>                : 
<span class="lineNum">     108 </span>                : namespace tt_detail {
<span class="lineNum">     109 </span>                : 
<span class="lineNum">     110 </span>                : // ************************************************************************** //
<span class="lineNum">     111 </span>                : // **************            TOOL BOX Implementation           ************** //
<span class="lineNum">     112 </span>                : // ************************************************************************** //
<span class="lineNum">     113 </span>                : 
<span class="lineNum">     114 </span>                : using ::boost::unit_test::lazy_ostream;
<span class="lineNum">     115 </span>                : 
<span class="lineNum">     116 </span>                : bool
<span class="lineNum">     117 </span>                : check_impl( predicate_result const&amp; pr, lazy_ostream const&amp; check_descr,
<span class="lineNum">     118 </span>                :             const_string file_name, std::size_t line_num,
<span class="lineNum">     119 </span>                :             tool_level tl, check_type ct,
<span class="lineNum">     120 </span><span class="lineCov">             14 :             std::size_t num_of_args, ... )</span>
<span class="lineNum">     121 </span>                : {
<span class="lineNum">     122 </span>                :     using namespace unit_test;
<span class="lineNum">     123 </span>                : 
<span class="lineNum">     124 </span><span class="lineCov">             14 :     if( !framework::is_initialized() )</span>
<span class="lineNum">     125 </span><span class="lineNoCov">              0 :         throw std::runtime_error( &quot;can't use testing tools before framework is initialized&quot; );</span>
<span class="lineNum">     126 </span>                : 
<span class="lineNum">     127 </span><span class="lineCov">             14 :     if( !!pr )</span>
<span class="lineNum">     128 </span><span class="lineCov">             14 :         tl = PASS;</span>
<span class="lineNum">     129 </span>                : 
<span class="lineNum">     130 </span>                :     log_level    ll;
<span class="lineNum">     131 </span>                :     char const*  prefix;
<span class="lineNum">     132 </span>                :     char const*  suffix;
<span class="lineNum">     133 </span>                :        
<span class="lineNum">     134 </span><span class="lineCov">             14 :     switch( tl ) {</span>
<span class="lineNum">     135 </span>                :     case PASS:
<span class="lineNum">     136 </span><span class="lineCov">             14 :         ll      = log_successful_tests;</span>
<span class="lineNum">     137 </span><span class="lineCov">             14 :         prefix  = &quot;check &quot;;</span>
<span class="lineNum">     138 </span><span class="lineCov">             14 :         suffix  = &quot; passed&quot;;</span>
<span class="lineNum">     139 </span><span class="lineCov">             14 :         break;</span>
<span class="lineNum">     140 </span>                :     case WARN:
<span class="lineNum">     141 </span><span class="lineNoCov">              0 :         ll      = log_warnings;</span>
<span class="lineNum">     142 </span><span class="lineNoCov">              0 :         prefix  = &quot;condition &quot;;</span>
<span class="lineNum">     143 </span><span class="lineNoCov">              0 :         suffix  = &quot; is not satisfied&quot;;</span>
<span class="lineNum">     144 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     145 </span>                :     case CHECK:
<span class="lineNum">     146 </span><span class="lineNoCov">              0 :         ll      = log_all_errors;</span>
<span class="lineNum">     147 </span><span class="lineNoCov">              0 :         prefix  = &quot;check &quot;;</span>
<span class="lineNum">     148 </span><span class="lineNoCov">              0 :         suffix  = &quot; failed&quot;;</span>
<span class="lineNum">     149 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     150 </span>                :     case REQUIRE:
<span class="lineNum">     151 </span><span class="lineNoCov">              0 :         ll      = log_fatal_errors;</span>
<span class="lineNum">     152 </span><span class="lineNoCov">              0 :         prefix  = &quot;critical check &quot;;</span>
<span class="lineNum">     153 </span><span class="lineNoCov">              0 :         suffix  = &quot; failed&quot;;</span>
<span class="lineNum">     154 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     155 </span>                :     default:
<span class="lineNum">     156 </span><span class="lineNoCov">              0 :         return true;</span>
<span class="lineNum">     157 </span>                :     }
<span class="lineNum">     158 </span>                : 
<span class="lineNum">     159 </span><span class="lineCov">             14 :     switch( ct ) {</span>
<span class="lineNum">     160 </span>                :     case CHECK_PRED:
<span class="lineNum">     161 </span>                :         unit_test_log &lt;&lt; unit_test::log::begin( file_name, line_num ) 
<span class="lineNum">     162 </span><span class="lineCov">             14 :                       &lt;&lt; ll &lt;&lt; prefix &lt;&lt; check_descr &lt;&lt; suffix;</span>
<span class="lineNum">     163 </span>                :         
<span class="lineNum">     164 </span><span class="lineCov">             14 :         if( !pr.has_empty_message() )</span>
<span class="lineNum">     165 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;. &quot; &lt;&lt; pr.message();</span>
<span class="lineNum">     166 </span>                :         
<span class="lineNum">     167 </span><span class="lineCov">             14 :         unit_test_log &lt;&lt; unit_test::log::end();</span>
<span class="lineNum">     168 </span><span class="lineCov">             14 :         break;</span>
<span class="lineNum">     169 </span>                : 
<span class="lineNum">     170 </span>                :     case CHECK_MSG:
<span class="lineNum">     171 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::begin( file_name, line_num ) &lt;&lt; ll;</span>
<span class="lineNum">     172 </span>                :         
<span class="lineNum">     173 </span><span class="lineNoCov">              0 :         if( tl == PASS )</span>
<span class="lineNum">     174 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; prefix &lt;&lt; &quot;'&quot; &lt;&lt; check_descr &lt;&lt; &quot;'&quot; &lt;&lt; suffix;</span>
<span class="lineNum">     175 </span>                :         else
<span class="lineNum">     176 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; check_descr;</span>
<span class="lineNum">     177 </span>                :         
<span class="lineNum">     178 </span><span class="lineNoCov">              0 :         if( !pr.has_empty_message() )</span>
<span class="lineNum">     179 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;. &quot; &lt;&lt; pr.message();</span>
<span class="lineNum">     180 </span>                : 
<span class="lineNum">     181 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::end();</span>
<span class="lineNum">     182 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     183 </span>                : 
<span class="lineNum">     184 </span>                :     case CHECK_EQUAL: 
<span class="lineNum">     185 </span>                :     case CHECK_NE: 
<span class="lineNum">     186 </span>                :     case CHECK_LT: 
<span class="lineNum">     187 </span>                :     case CHECK_LE: 
<span class="lineNum">     188 </span>                :     case CHECK_GT: 
<span class="lineNum">     189 </span>                :     case CHECK_GE: {
<span class="lineNum">     190 </span>                :         static char const* check_str [] = { &quot; == &quot;, &quot; != &quot;, &quot; &lt; &quot; , &quot; &lt;= &quot;, &quot; &gt; &quot; , &quot; &gt;= &quot; };
<span class="lineNum">     191 </span>                :         static char const* rever_str [] = { &quot; != &quot;, &quot; == &quot;, &quot; &gt;= &quot;, &quot; &gt; &quot; , &quot; &lt;= &quot;, &quot; &lt; &quot;  };
<span class="lineNum">     192 </span>                : 
<span class="lineNum">     193 </span>                :         va_list args;
<span class="lineNum">     194 </span>                : 
<span class="lineNum">     195 </span><span class="lineNoCov">              0 :         va_start( args, num_of_args );</span>
<span class="lineNum">     196 </span><span class="lineNoCov">              0 :         char const*         arg1_descr  = va_arg( args, char const* );</span>
<span class="lineNum">     197 </span><span class="lineNoCov">              0 :         lazy_ostream const* arg1_val    = va_arg( args, lazy_ostream const* );</span>
<span class="lineNum">     198 </span><span class="lineNoCov">              0 :         char const*         arg2_descr  = va_arg( args, char const* );</span>
<span class="lineNum">     199 </span><span class="lineNoCov">              0 :         lazy_ostream const* arg2_val    = va_arg( args, lazy_ostream const* );</span>
<span class="lineNum">     200 </span>                : 
<span class="lineNum">     201 </span>                :         unit_test_log &lt;&lt; unit_test::log::begin( file_name, line_num ) 
<span class="lineNum">     202 </span><span class="lineNoCov">              0 :                       &lt;&lt; ll &lt;&lt; prefix &lt;&lt; arg1_descr &lt;&lt; check_str[ct-CHECK_EQUAL] &lt;&lt; arg2_descr &lt;&lt; suffix;</span>
<span class="lineNum">     203 </span>                : 
<span class="lineNum">     204 </span><span class="lineNoCov">              0 :         if( tl != PASS )</span>
<span class="lineNum">     205 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot; [&quot; &lt;&lt; *arg1_val &lt;&lt; rever_str[ct-CHECK_EQUAL] &lt;&lt; *arg2_val &lt;&lt; &quot;]&quot; ;</span>
<span class="lineNum">     206 </span>                : 
<span class="lineNum">     207 </span><span class="lineNoCov">              0 :         va_end( args );</span>
<span class="lineNum">     208 </span>                :         
<span class="lineNum">     209 </span><span class="lineNoCov">              0 :         if( !pr.has_empty_message() )</span>
<span class="lineNum">     210 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;. &quot; &lt;&lt; pr.message();</span>
<span class="lineNum">     211 </span>                : 
<span class="lineNum">     212 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::end();</span>
<span class="lineNum">     213 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     214 </span>                :     }
<span class="lineNum">     215 </span>                : 
<span class="lineNum">     216 </span>                :     case CHECK_CLOSE:
<span class="lineNum">     217 </span>                :     case CHECK_CLOSE_FRACTION: {
<span class="lineNum">     218 </span>                :         va_list args;
<span class="lineNum">     219 </span>                : 
<span class="lineNum">     220 </span><span class="lineNoCov">              0 :         va_start( args, num_of_args );</span>
<span class="lineNum">     221 </span><span class="lineNoCov">              0 :         char const*         arg1_descr  = va_arg( args, char const* );</span>
<span class="lineNum">     222 </span><span class="lineNoCov">              0 :         lazy_ostream const* arg1_val    = va_arg( args, lazy_ostream const* );</span>
<span class="lineNum">     223 </span><span class="lineNoCov">              0 :         char const*         arg2_descr  = va_arg( args, char const* );</span>
<span class="lineNum">     224 </span><span class="lineNoCov">              0 :         lazy_ostream const* arg2_val    = va_arg( args, lazy_ostream const* );</span>
<span class="lineNum">     225 </span><span class="lineNoCov">              0 :         /* toler_descr = */               va_arg( args, char const* );</span>
<span class="lineNum">     226 </span><span class="lineNoCov">              0 :         lazy_ostream const* toler_val   = va_arg( args, lazy_ostream const* );</span>
<span class="lineNum">     227 </span>                : 
<span class="lineNum">     228 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::begin( file_name, line_num ) &lt;&lt; ll;</span>
<span class="lineNum">     229 </span>                : 
<span class="lineNum">     230 </span>                :         unit_test_log &lt;&lt; &quot;difference between &quot; &lt;&lt; arg1_descr &lt;&lt; &quot;{&quot; &lt;&lt; *arg1_val &lt;&lt; &quot;}&quot; 
<span class="lineNum">     231 </span>                :                       &lt;&lt; &quot; and &quot;               &lt;&lt; arg2_descr &lt;&lt; &quot;{&quot; &lt;&lt; *arg2_val &lt;&lt; &quot;}&quot;
<span class="lineNum">     232 </span>                :                       &lt;&lt; ( tl == PASS ? &quot; doesn't exceed &quot; : &quot; exceeds &quot; )
<span class="lineNum">     233 </span><span class="lineNoCov">              0 :                       &lt;&lt; *toler_val;</span>
<span class="lineNum">     234 </span><span class="lineNoCov">              0 :         if( ct == CHECK_CLOSE )</span>
<span class="lineNum">     235 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;%&quot;;</span>
<span class="lineNum">     236 </span>                : 
<span class="lineNum">     237 </span><span class="lineNoCov">              0 :         va_end( args );</span>
<span class="lineNum">     238 </span>                :         
<span class="lineNum">     239 </span><span class="lineNoCov">              0 :         if( !pr.has_empty_message() )</span>
<span class="lineNum">     240 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;. &quot; &lt;&lt; pr.message();</span>
<span class="lineNum">     241 </span>                : 
<span class="lineNum">     242 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::end();</span>
<span class="lineNum">     243 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     244 </span>                :     }
<span class="lineNum">     245 </span>                :     case CHECK_SMALL: {
<span class="lineNum">     246 </span>                :         va_list args;
<span class="lineNum">     247 </span>                : 
<span class="lineNum">     248 </span><span class="lineNoCov">              0 :         va_start( args, num_of_args );</span>
<span class="lineNum">     249 </span><span class="lineNoCov">              0 :         char const*         arg1_descr  = va_arg( args, char const* );</span>
<span class="lineNum">     250 </span><span class="lineNoCov">              0 :         lazy_ostream const* arg1_val    = va_arg( args, lazy_ostream const* );</span>
<span class="lineNum">     251 </span><span class="lineNoCov">              0 :         /* toler_descr = */               va_arg( args, char const* );</span>
<span class="lineNum">     252 </span><span class="lineNoCov">              0 :         lazy_ostream const* toler_val   = va_arg( args, lazy_ostream const* );</span>
<span class="lineNum">     253 </span>                : 
<span class="lineNum">     254 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::begin( file_name, line_num ) &lt;&lt; ll;</span>
<span class="lineNum">     255 </span>                : 
<span class="lineNum">     256 </span>                :         unit_test_log &lt;&lt; &quot;absolute value of &quot; &lt;&lt; arg1_descr &lt;&lt; &quot;{&quot; &lt;&lt; *arg1_val &lt;&lt; &quot;}&quot; 
<span class="lineNum">     257 </span>                :                       &lt;&lt; ( tl == PASS ? &quot; doesn't exceed &quot; : &quot; exceeds &quot; )
<span class="lineNum">     258 </span><span class="lineNoCov">              0 :                       &lt;&lt; *toler_val;</span>
<span class="lineNum">     259 </span>                : 
<span class="lineNum">     260 </span><span class="lineNoCov">              0 :         va_end( args );</span>
<span class="lineNum">     261 </span>                :         
<span class="lineNum">     262 </span><span class="lineNoCov">              0 :         if( !pr.has_empty_message() )</span>
<span class="lineNum">     263 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;. &quot; &lt;&lt; pr.message();</span>
<span class="lineNum">     264 </span>                : 
<span class="lineNum">     265 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::end();</span>
<span class="lineNum">     266 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     267 </span>                :     }
<span class="lineNum">     268 </span>                : 
<span class="lineNum">     269 </span>                :     case CHECK_PRED_WITH_ARGS: {
<span class="lineNum">     270 </span>                :         unit_test_log &lt;&lt; unit_test::log::begin( file_name, line_num ) 
<span class="lineNum">     271 </span><span class="lineNoCov">              0 :                       &lt;&lt; ll &lt;&lt; prefix &lt;&lt; check_descr;</span>
<span class="lineNum">     272 </span>                : 
<span class="lineNum">     273 </span>                :         // print predicate call description
<span class="lineNum">     274 </span>                :         {
<span class="lineNum">     275 </span>                :             va_list args;
<span class="lineNum">     276 </span><span class="lineNoCov">              0 :             va_start( args, num_of_args );</span>
<span class="lineNum">     277 </span>                : 
<span class="lineNum">     278 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;( &quot;;</span>
<span class="lineNum">     279 </span><span class="lineNoCov">              0 :             for( std::size_t i = 0; i &lt; num_of_args; ++i ) {</span>
<span class="lineNum">     280 </span><span class="lineNoCov">              0 :                 unit_test_log &lt;&lt; va_arg( args, char const* );</span>
<span class="lineNum">     281 </span><span class="lineNoCov">              0 :                 va_arg( args, lazy_ostream const* ); // skip argument value;</span>
<span class="lineNum">     282 </span>                :                 
<span class="lineNum">     283 </span><span class="lineNoCov">              0 :                 if( i != num_of_args-1 )</span>
<span class="lineNum">     284 </span><span class="lineNoCov">              0 :                     unit_test_log &lt;&lt; &quot;, &quot;;</span>
<span class="lineNum">     285 </span>                :             }
<span class="lineNum">     286 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot; )&quot; &lt;&lt; suffix;</span>
<span class="lineNum">     287 </span><span class="lineNoCov">              0 :             va_end( args );</span>
<span class="lineNum">     288 </span>                :         }
<span class="lineNum">     289 </span>                :                         
<span class="lineNum">     290 </span><span class="lineNoCov">              0 :         if( tl != PASS ) {</span>
<span class="lineNum">     291 </span>                :             va_list args;
<span class="lineNum">     292 </span><span class="lineNoCov">              0 :             va_start( args, num_of_args );</span>
<span class="lineNum">     293 </span>                : 
<span class="lineNum">     294 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot; for ( &quot;;</span>
<span class="lineNum">     295 </span><span class="lineNoCov">              0 :             for( std::size_t i = 0; i &lt; num_of_args; ++i ) {</span>
<span class="lineNum">     296 </span><span class="lineNoCov">              0 :                 va_arg( args, char const* ); // skip argument description;            </span>
<span class="lineNum">     297 </span><span class="lineNoCov">              0 :                 unit_test_log &lt;&lt; *va_arg( args, lazy_ostream const* );</span>
<span class="lineNum">     298 </span>                :                 
<span class="lineNum">     299 </span><span class="lineNoCov">              0 :                 if( i != num_of_args-1 )</span>
<span class="lineNum">     300 </span><span class="lineNoCov">              0 :                     unit_test_log &lt;&lt; &quot;, &quot;;</span>
<span class="lineNum">     301 </span>                :             }
<span class="lineNum">     302 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot; )&quot;;</span>
<span class="lineNum">     303 </span><span class="lineNoCov">              0 :             va_end( args );</span>
<span class="lineNum">     304 </span>                :         }
<span class="lineNum">     305 </span>                :        
<span class="lineNum">     306 </span><span class="lineNoCov">              0 :         if( !pr.has_empty_message() )</span>
<span class="lineNum">     307 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;. &quot; &lt;&lt; pr.message();</span>
<span class="lineNum">     308 </span>                : 
<span class="lineNum">     309 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::end();</span>
<span class="lineNum">     310 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     311 </span>                :     }
<span class="lineNum">     312 </span>                : 
<span class="lineNum">     313 </span>                :     case CHECK_EQUAL_COLL: {
<span class="lineNum">     314 </span>                :         va_list args;
<span class="lineNum">     315 </span>                : 
<span class="lineNum">     316 </span><span class="lineNoCov">              0 :         va_start( args, num_of_args );</span>
<span class="lineNum">     317 </span><span class="lineNoCov">              0 :         char const* left_begin_descr    = va_arg( args, char const* );</span>
<span class="lineNum">     318 </span><span class="lineNoCov">              0 :         char const* left_end_descr      = va_arg( args, char const* );</span>
<span class="lineNum">     319 </span><span class="lineNoCov">              0 :         char const* right_begin_descr   = va_arg( args, char const* );</span>
<span class="lineNum">     320 </span><span class="lineNoCov">              0 :         char const* right_end_descr     = va_arg( args, char const* );</span>
<span class="lineNum">     321 </span>                : 
<span class="lineNum">     322 </span>                :         unit_test_log &lt;&lt; unit_test::log::begin( file_name, line_num ) 
<span class="lineNum">     323 </span>                :                       &lt;&lt; ll &lt;&lt; prefix 
<span class="lineNum">     324 </span>                :                       &lt;&lt; &quot;{ &quot; &lt;&lt; left_begin_descr  &lt;&lt; &quot;, &quot; &lt;&lt; left_end_descr  &lt;&lt; &quot; } == { &quot; 
<span class="lineNum">     325 </span>                :                               &lt;&lt; right_begin_descr &lt;&lt; &quot;, &quot; &lt;&lt; right_end_descr &lt;&lt; &quot; }&quot;
<span class="lineNum">     326 </span><span class="lineNoCov">              0 :                       &lt;&lt; suffix;</span>
<span class="lineNum">     327 </span>                : 
<span class="lineNum">     328 </span><span class="lineNoCov">              0 :         va_end( args );</span>
<span class="lineNum">     329 </span>                :         
<span class="lineNum">     330 </span><span class="lineNoCov">              0 :         if( !pr.has_empty_message() )</span>
<span class="lineNum">     331 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;. &quot; &lt;&lt; pr.message();</span>
<span class="lineNum">     332 </span>                : 
<span class="lineNum">     333 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::end();</span>
<span class="lineNum">     334 </span><span class="lineNoCov">              0 :         break;</span>
<span class="lineNum">     335 </span>                :     }
<span class="lineNum">     336 </span>                : 
<span class="lineNum">     337 </span>                :     case CHECK_BITWISE_EQUAL: {
<span class="lineNum">     338 </span>                :         va_list args;
<span class="lineNum">     339 </span>                : 
<span class="lineNum">     340 </span><span class="lineNoCov">              0 :         va_start( args, num_of_args );</span>
<span class="lineNum">     341 </span><span class="lineNoCov">              0 :         char const* left_descr    = va_arg( args, char const* );</span>
<span class="lineNum">     342 </span><span class="lineNoCov">              0 :         char const* right_descr   = va_arg( args, char const* );</span>
<span class="lineNum">     343 </span>                : 
<span class="lineNum">     344 </span>                :         unit_test_log &lt;&lt; unit_test::log::begin( file_name, line_num )
<span class="lineNum">     345 </span><span class="lineNoCov">              0 :                       &lt;&lt; ll &lt;&lt; prefix &lt;&lt; left_descr  &lt;&lt; &quot; =.= &quot; &lt;&lt; right_descr &lt;&lt; suffix;</span>
<span class="lineNum">     346 </span>                : 
<span class="lineNum">     347 </span><span class="lineNoCov">              0 :         va_end( args );</span>
<span class="lineNum">     348 </span>                :         
<span class="lineNum">     349 </span><span class="lineNoCov">              0 :         if( !pr.has_empty_message() )</span>
<span class="lineNum">     350 </span><span class="lineNoCov">              0 :             unit_test_log &lt;&lt; &quot;. &quot; &lt;&lt; pr.message();</span>
<span class="lineNum">     351 </span>                : 
<span class="lineNum">     352 </span><span class="lineNoCov">              0 :         unit_test_log &lt;&lt; unit_test::log::end();</span>
<span class="lineNum">     353 </span>                :         break;
<span class="lineNum">     354 </span>                :     }
<span class="lineNum">     355 </span>                :     }
<span class="lineNum">     356 </span>                : 
<span class="lineNum">     357 </span><span class="lineCov">             14 :     switch( tl ) {</span>
<span class="lineNum">     358 </span>                :     case PASS:
<span class="lineNum">     359 </span><span class="lineCov">             14 :         framework::assertion_result( true );</span>
<span class="lineNum">     360 </span><span class="lineCov">             14 :         return true;</span>
<span class="lineNum">     361 </span>                : 
<span class="lineNum">     362 </span>                :     case WARN:
<span class="lineNum">     363 </span><span class="lineNoCov">              0 :         return false;</span>
<span class="lineNum">     364 </span>                : 
<span class="lineNum">     365 </span>                :     case CHECK:
<span class="lineNum">     366 </span><span class="lineNoCov">              0 :         framework::assertion_result( false );</span>
<span class="lineNum">     367 </span><span class="lineNoCov">              0 :         return false;</span>
<span class="lineNum">     368 </span>                :         
<span class="lineNum">     369 </span>                :     case REQUIRE:
<span class="lineNum">     370 </span><span class="lineNoCov">              0 :         framework::assertion_result( false );</span>
<span class="lineNum">     371 </span>                : 
<span class="lineNum">     372 </span><span class="lineNoCov">              0 :         framework::test_unit_aborted( framework::current_test_case() );</span>
<span class="lineNum">     373 </span>                : 
<span class="lineNum">     374 </span><span class="lineNoCov">              0 :         throw execution_aborted();</span>
<span class="lineNum">     375 </span>                :     }
<span class="lineNum">     376 </span>                : 
<span class="lineNum">     377 </span><span class="lineNoCov">              0 :     return true;</span>
<span class="lineNum">     378 </span>                : }
<span class="lineNum">     379 </span>                : 
<span class="lineNum">     380 </span>                : //____________________________________________________________________________//
<span class="lineNum">     381 </span>                : 
<span class="lineNum">     382 </span>                : predicate_result
<span class="lineNum">     383 </span><span class="lineNoCov">              0 : equal_impl( char const* left, char const* right )</span>
<span class="lineNum">     384 </span>                : {
<span class="lineNum">     385 </span><span class="lineNoCov">              0 :     return (left &amp;&amp; right) ? std::strcmp( left, right ) == 0 : (left == right);</span>
<span class="lineNum">     386 </span>                : }
<span class="lineNum">     387 </span>                : 
<span class="lineNum">     388 </span>                : //____________________________________________________________________________//
<span class="lineNum">     389 </span>                : 
<span class="lineNum">     390 </span>                : #if !defined( BOOST_NO_CWCHAR )
<span class="lineNum">     391 </span>                : 
<span class="lineNum">     392 </span>                : predicate_result
<span class="lineNum">     393 </span><span class="lineNoCov">              0 : equal_impl( wchar_t const* left, wchar_t const* right )</span>
<span class="lineNum">     394 </span>                : {
<span class="lineNum">     395 </span><span class="lineNoCov">              0 :     return (left &amp;&amp; right) ? std::wcscmp( left, right ) == 0 : (left == right);</span>
<span class="lineNum">     396 </span>                : }
<span class="lineNum">     397 </span>                : 
<span class="lineNum">     398 </span>                : #endif // !defined( BOOST_NO_CWCHAR )
<span class="lineNum">     399 </span>                : 
<span class="lineNum">     400 </span>                : //____________________________________________________________________________//
<span class="lineNum">     401 </span>                : 
<span class="lineNum">     402 </span>                : bool
<span class="lineNum">     403 </span><span class="lineNoCov">              0 : is_defined_impl( const_string symbol_name, const_string symbol_value )</span>
<span class="lineNum">     404 </span>                : {
<span class="lineNum">     405 </span><span class="lineNoCov">              0 :     symbol_value.trim_left( 2 );</span>
<span class="lineNum">     406 </span><span class="lineNoCov">              0 :     return symbol_name != symbol_value;</span>
<span class="lineNum">     407 </span>                : }
<span class="lineNum">     408 </span>                : 
<span class="lineNum">     409 </span>                : //____________________________________________________________________________//
<span class="lineNum">     410 </span>                : 
<span class="lineNum">     411 </span>                : } // namespace tt_detail
<span class="lineNum">     412 </span>                : 
<span class="lineNum">     413 </span>                : // ************************************************************************** //
<span class="lineNum">     414 </span>                : // **************               output_test_stream             ************** //
<span class="lineNum">     415 </span>                : // ************************************************************************** //
<span class="lineNum">     416 </span>                : 
<span class="lineNum">     417 </span>                : struct output_test_stream::Impl
<span class="lineNum">     418 </span><span class="lineNoCov">              0 : {</span>
<span class="lineNum">     419 </span>                :     std::fstream    m_pattern;
<span class="lineNum">     420 </span>                :     bool            m_match_or_save;
<span class="lineNum">     421 </span>                :     bool            m_text_or_binary;
<span class="lineNum">     422 </span>                :     std::string     m_synced_string;
<span class="lineNum">     423 </span>                : 
<span class="lineNum">     424 </span><span class="lineNoCov">              0 :     char            get_char()</span>
<span class="lineNum">     425 </span>                :     {
<span class="lineNum">     426 </span>                :         char res;
<span class="lineNum">     427 </span><span class="lineNoCov">              0 :         do {</span>
<span class="lineNum">     428 </span><span class="lineNoCov">              0 :             m_pattern.get( res );</span>
<span class="lineNum">     429 </span>                :         } while( m_text_or_binary &amp;&amp; res == '\r' &amp;&amp; !m_pattern.fail() &amp;&amp; !m_pattern.eof() );
<span class="lineNum">     430 </span>                : 
<span class="lineNum">     431 </span><span class="lineNoCov">              0 :         return res;</span>
<span class="lineNum">     432 </span>                :     }
<span class="lineNum">     433 </span>                : 
<span class="lineNum">     434 </span><span class="lineNoCov">              0 :     void            check_and_fill( predicate_result&amp; res )</span>
<span class="lineNum">     435 </span>                :     {
<span class="lineNum">     436 </span><span class="lineNoCov">              0 :         if( !res.p_predicate_value )</span>
<span class="lineNum">     437 </span><span class="lineNoCov">              0 :             res.message() &lt;&lt; &quot;Output content: \&quot;&quot; &lt;&lt; m_synced_string &lt;&lt; '\&quot;';</span>
<span class="lineNum">     438 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     439 </span>                : };
<span class="lineNum">     440 </span>                : 
<span class="lineNum">     441 </span>                : //____________________________________________________________________________//
<span class="lineNum">     442 </span>                : 
<span class="lineNum">     443 </span><span class="lineNoCov">              0 : output_test_stream::output_test_stream( const_string pattern_file_name, bool match_or_save, bool text_or_binary )</span>
<span class="lineNum">     444 </span><span class="lineNoCov">              0 : : m_pimpl( new Impl )</span>
<span class="lineNum">     445 </span>                : {
<span class="lineNum">     446 </span><span class="lineNoCov">              0 :     if( !pattern_file_name.is_empty() ) {</span>
<span class="lineNum">     447 </span><span class="lineNoCov">              0 :         std::ios::openmode m = match_or_save ? std::ios::in : std::ios::out;</span>
<span class="lineNum">     448 </span><span class="lineNoCov">              0 :         if( !text_or_binary )</span>
<span class="lineNum">     449 </span><span class="lineNoCov">              0 :             m |= std::ios::binary;</span>
<span class="lineNum">     450 </span>                : 
<span class="lineNum">     451 </span><span class="lineNoCov">              0 :         m_pimpl-&gt;m_pattern.open( pattern_file_name.begin(), m );</span>
<span class="lineNum">     452 </span>                : 
<span class="lineNum">     453 </span><span class="lineNoCov">              0 :         BOOST_WARN_MESSAGE( m_pimpl-&gt;m_pattern.is_open(),</span>
<span class="lineNum">     454 </span>                :                              &quot;Couldn't open pattern file &quot; &lt;&lt; pattern_file_name
<span class="lineNum">     455 </span>                :                                 &lt;&lt; &quot; for &quot; &lt;&lt; (match_or_save ? &quot;reading&quot; : &quot;writing&quot;) );
<span class="lineNum">     456 </span>                :     }
<span class="lineNum">     457 </span>                : 
<span class="lineNum">     458 </span><span class="lineNoCov">              0 :     m_pimpl-&gt;m_match_or_save    = match_or_save;</span>
<span class="lineNum">     459 </span><span class="lineNoCov">              0 :     m_pimpl-&gt;m_text_or_binary   = text_or_binary;</span>
<span class="lineNum">     460 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     461 </span>                : 
<span class="lineNum">     462 </span>                : //____________________________________________________________________________//
<span class="lineNum">     463 </span>                : 
<span class="lineNum">     464 </span><span class="lineNoCov">              0 : output_test_stream::~output_test_stream()</span>
<span class="lineNum">     465 </span>                : {
<span class="lineNum">     466 </span><span class="lineNoCov">              0 :     delete m_pimpl;</span>
<span class="lineNum">     467 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     468 </span>                : 
<span class="lineNum">     469 </span>                : //____________________________________________________________________________//
<span class="lineNum">     470 </span>                : 
<span class="lineNum">     471 </span>                : predicate_result
<span class="lineNum">     472 </span><span class="lineNoCov">              0 : output_test_stream::is_empty( bool flush_stream )</span>
<span class="lineNum">     473 </span>                : {
<span class="lineNum">     474 </span><span class="lineNoCov">              0 :     sync();</span>
<span class="lineNum">     475 </span>                : 
<span class="lineNum">     476 </span><span class="lineNoCov">              0 :     result_type res( m_pimpl-&gt;m_synced_string.empty() );</span>
<span class="lineNum">     477 </span>                : 
<span class="lineNum">     478 </span><span class="lineNoCov">              0 :     m_pimpl-&gt;check_and_fill( res );</span>
<span class="lineNum">     479 </span>                : 
<span class="lineNum">     480 </span><span class="lineNoCov">              0 :     if( flush_stream )</span>
<span class="lineNum">     481 </span><span class="lineNoCov">              0 :         flush();</span>
<span class="lineNum">     482 </span>                : 
<span class="lineNum">     483 </span><span class="lineNoCov">              0 :     return res;</span>
<span class="lineNum">     484 </span>                : }
<span class="lineNum">     485 </span>                : 
<span class="lineNum">     486 </span>                : //____________________________________________________________________________//
<span class="lineNum">     487 </span>                : 
<span class="lineNum">     488 </span>                : predicate_result
<span class="lineNum">     489 </span><span class="lineNoCov">              0 : output_test_stream::check_length( std::size_t length_, bool flush_stream )</span>
<span class="lineNum">     490 </span>                : {
<span class="lineNum">     491 </span><span class="lineNoCov">              0 :     sync();</span>
<span class="lineNum">     492 </span>                : 
<span class="lineNum">     493 </span><span class="lineNoCov">              0 :     result_type res( m_pimpl-&gt;m_synced_string.length() == length_ );</span>
<span class="lineNum">     494 </span>                : 
<span class="lineNum">     495 </span><span class="lineNoCov">              0 :     m_pimpl-&gt;check_and_fill( res );</span>
<span class="lineNum">     496 </span>                : 
<span class="lineNum">     497 </span><span class="lineNoCov">              0 :     if( flush_stream )</span>
<span class="lineNum">     498 </span><span class="lineNoCov">              0 :         flush();</span>
<span class="lineNum">     499 </span>                : 
<span class="lineNum">     500 </span><span class="lineNoCov">              0 :     return res;</span>
<span class="lineNum">     501 </span>                : }
<span class="lineNum">     502 </span>                : 
<span class="lineNum">     503 </span>                : //____________________________________________________________________________//
<span class="lineNum">     504 </span>                : 
<span class="lineNum">     505 </span>                : predicate_result
<span class="lineNum">     506 </span><span class="lineNoCov">              0 : output_test_stream::is_equal( const_string arg, bool flush_stream )</span>
<span class="lineNum">     507 </span>                : {
<span class="lineNum">     508 </span><span class="lineNoCov">              0 :     sync();</span>
<span class="lineNum">     509 </span>                : 
<span class="lineNum">     510 </span><span class="lineNoCov">              0 :     result_type res( const_string( m_pimpl-&gt;m_synced_string ) == arg );</span>
<span class="lineNum">     511 </span>                : 
<span class="lineNum">     512 </span><span class="lineNoCov">              0 :     m_pimpl-&gt;check_and_fill( res );</span>
<span class="lineNum">     513 </span>                : 
<span class="lineNum">     514 </span><span class="lineNoCov">              0 :     if( flush_stream )</span>
<span class="lineNum">     515 </span><span class="lineNoCov">              0 :         flush();</span>
<span class="lineNum">     516 </span>                : 
<span class="lineNum">     517 </span><span class="lineNoCov">              0 :     return res;</span>
<span class="lineNum">     518 </span>                : }
<span class="lineNum">     519 </span>                : 
<span class="lineNum">     520 </span>                : //____________________________________________________________________________//
<span class="lineNum">     521 </span>                : 
<span class="lineNum">     522 </span>                : predicate_result
<span class="lineNum">     523 </span><span class="lineNoCov">              0 : output_test_stream::match_pattern( bool flush_stream )</span>
<span class="lineNum">     524 </span>                : {
<span class="lineNum">     525 </span><span class="lineNoCov">              0 :     sync();</span>
<span class="lineNum">     526 </span>                : 
<span class="lineNum">     527 </span><span class="lineNoCov">              0 :     result_type result( true );</span>
<span class="lineNum">     528 </span>                : 
<span class="lineNum">     529 </span><span class="lineNoCov">              0 :     if( !m_pimpl-&gt;m_pattern.is_open() ) {</span>
<span class="lineNum">     530 </span><span class="lineNoCov">              0 :         result = false;</span>
<span class="lineNum">     531 </span><span class="lineNoCov">              0 :         result.message() &lt;&lt; &quot;Pattern file could not be opened!&quot;;</span>
<span class="lineNum">     532 </span>                :     }
<span class="lineNum">     533 </span>                :     else {
<span class="lineNum">     534 </span><span class="lineNoCov">              0 :         if( m_pimpl-&gt;m_match_or_save ) {</span>
<span class="lineNum">     535 </span><span class="lineNoCov">              0 :             for ( std::string::size_type i = 0; i &lt; m_pimpl-&gt;m_synced_string.length(); ++i ) {</span>
<span class="lineNum">     536 </span><span class="lineNoCov">              0 :                 char c = m_pimpl-&gt;get_char();</span>
<span class="lineNum">     537 </span>                : 
<span class="lineNum">     538 </span>                :                 result = !m_pimpl-&gt;m_pattern.fail() &amp;&amp;
<span class="lineNum">     539 </span>                :                          !m_pimpl-&gt;m_pattern.eof()  &amp;&amp;
<span class="lineNum">     540 </span><span class="lineNoCov">              0 :                          (m_pimpl-&gt;m_synced_string[i] == c);</span>
<span class="lineNum">     541 </span>                : 
<span class="lineNum">     542 </span><span class="lineNoCov">              0 :                 if( !result ) {</span>
<span class="lineNum">     543 </span>                :                     std::string::size_type suffix_size  = (std::min)( m_pimpl-&gt;m_synced_string.length() - i,
<span class="lineNum">     544 </span><span class="lineNoCov">              0 :                                                                     static_cast&lt;std::string::size_type&gt;(5) );</span>
<span class="lineNum">     545 </span>                : 
<span class="lineNum">     546 </span>                :                     // try to log area around the mismatch
<span class="lineNum">     547 </span>                :                     result.message() &lt;&lt; &quot;Mismatch at position &quot; &lt;&lt; i &lt;&lt; '\n'
<span class="lineNum">     548 </span>                :                         &lt;&lt; &quot;...&quot; &lt;&lt; m_pimpl-&gt;m_synced_string.substr( i, suffix_size ) &lt;&lt; &quot;...&quot; &lt;&lt; '\n'
<span class="lineNum">     549 </span><span class="lineNoCov">              0 :                         &lt;&lt; &quot;...&quot; &lt;&lt; c;</span>
<span class="lineNum">     550 </span>                : 
<span class="lineNum">     551 </span><span class="lineNoCov">              0 :                     std::string::size_type counter = suffix_size;</span>
<span class="lineNum">     552 </span><span class="lineNoCov">              0 :                     while( --counter ) {</span>
<span class="lineNum">     553 </span><span class="lineNoCov">              0 :                         char c = m_pimpl-&gt;get_char();</span>
<span class="lineNum">     554 </span>                : 
<span class="lineNum">     555 </span><span class="lineNoCov">              0 :                         if( m_pimpl-&gt;m_pattern.fail() || m_pimpl-&gt;m_pattern.eof() )</span>
<span class="lineNum">     556 </span><span class="lineNoCov">              0 :                             break;</span>
<span class="lineNum">     557 </span>                : 
<span class="lineNum">     558 </span><span class="lineNoCov">              0 :                         result.message() &lt;&lt; c;</span>
<span class="lineNum">     559 </span>                :                     }
<span class="lineNum">     560 </span>                : 
<span class="lineNum">     561 </span><span class="lineNoCov">              0 :                     result.message() &lt;&lt; &quot;...&quot;;</span>
<span class="lineNum">     562 </span>                : 
<span class="lineNum">     563 </span>                :                     // skip rest of the bytes. May help for further matching
<span class="lineNum">     564 </span>                :                     m_pimpl-&gt;m_pattern.ignore( 
<span class="lineNum">     565 </span><span class="lineNoCov">              0 :                         static_cast&lt;std::streamsize&gt;( m_pimpl-&gt;m_synced_string.length() - i - suffix_size) );</span>
<span class="lineNum">     566 </span><span class="lineNoCov">              0 :                     break;</span>
<span class="lineNum">     567 </span>                :                 }
<span class="lineNum">     568 </span>                :             }
<span class="lineNum">     569 </span>                :         }
<span class="lineNum">     570 </span>                :         else {
<span class="lineNum">     571 </span>                :             m_pimpl-&gt;m_pattern.write( m_pimpl-&gt;m_synced_string.c_str(),
<span class="lineNum">     572 </span><span class="lineNoCov">              0 :                                       static_cast&lt;std::streamsize&gt;( m_pimpl-&gt;m_synced_string.length() ) );</span>
<span class="lineNum">     573 </span><span class="lineNoCov">              0 :             m_pimpl-&gt;m_pattern.flush();</span>
<span class="lineNum">     574 </span>                :         }
<span class="lineNum">     575 </span>                :     }
<span class="lineNum">     576 </span>                : 
<span class="lineNum">     577 </span><span class="lineNoCov">              0 :     if( flush_stream )</span>
<span class="lineNum">     578 </span><span class="lineNoCov">              0 :         flush();</span>
<span class="lineNum">     579 </span>                : 
<span class="lineNum">     580 </span><span class="lineNoCov">              0 :     return result;</span>
<span class="lineNum">     581 </span>                : }
<span class="lineNum">     582 </span>                : 
<span class="lineNum">     583 </span>                : //____________________________________________________________________________//
<span class="lineNum">     584 </span>                : 
<span class="lineNum">     585 </span>                : void
<span class="lineNum">     586 </span><span class="lineNoCov">              0 : output_test_stream::flush()</span>
<span class="lineNum">     587 </span>                : {
<span class="lineNum">     588 </span><span class="lineNoCov">              0 :     m_pimpl-&gt;m_synced_string.erase();</span>
<span class="lineNum">     589 </span>                : 
<span class="lineNum">     590 </span>                : #ifndef BOOST_NO_STRINGSTREAM
<span class="lineNum">     591 </span><span class="lineNoCov">              0 :     str( std::string() );</span>
<span class="lineNum">     592 </span>                : #else
<span class="lineNum">     593 </span>                :     seekp( 0, std::ios::beg );
<span class="lineNum">     594 </span>                : #endif
<span class="lineNum">     595 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     596 </span>                : 
<span class="lineNum">     597 </span>                : //____________________________________________________________________________//
<span class="lineNum">     598 </span>                : 
<span class="lineNum">     599 </span>                : std::size_t
<span class="lineNum">     600 </span><span class="lineNoCov">              0 : output_test_stream::length()</span>
<span class="lineNum">     601 </span>                : {
<span class="lineNum">     602 </span><span class="lineNoCov">              0 :     sync();</span>
<span class="lineNum">     603 </span>                : 
<span class="lineNum">     604 </span><span class="lineNoCov">              0 :     return m_pimpl-&gt;m_synced_string.length();</span>
<span class="lineNum">     605 </span>                : }
<span class="lineNum">     606 </span>                : 
<span class="lineNum">     607 </span>                : //____________________________________________________________________________//
<span class="lineNum">     608 </span>                : 
<span class="lineNum">     609 </span>                : void
<span class="lineNum">     610 </span><span class="lineNoCov">              0 : output_test_stream::sync()</span>
<span class="lineNum">     611 </span>                : {
<span class="lineNum">     612 </span>                : #ifdef BOOST_NO_STRINGSTREAM
<span class="lineNum">     613 </span>                :     m_pimpl-&gt;m_synced_string.assign( str(), pcount() );
<span class="lineNum">     614 </span>                :     freeze( false );
<span class="lineNum">     615 </span>                : #else
<span class="lineNum">     616 </span><span class="lineNoCov">              0 :     m_pimpl-&gt;m_synced_string = str();</span>
<span class="lineNum">     617 </span>                : #endif
<span class="lineNum">     618 </span><span class="lineNoCov">              0 : }</span>
<span class="lineNum">     619 </span>                : 
<span class="lineNum">     620 </span>                : //____________________________________________________________________________//
<span class="lineNum">     621 </span>                : 
<span class="lineNum">     622 </span>                : } // namespace test_tools
<span class="lineNum">     623 </span>                : 
<span class="lineNum">     624 </span>                : } // namespace boost
<span class="lineNum">     625 </span>                : 
<span class="lineNum">     626 </span>                : //____________________________________________________________________________//
<span class="lineNum">     627 </span>                : 
<span class="lineNum">     628 </span>                : #include &lt;boost/test/detail/enable_warnings.hpp&gt;
<span class="lineNum">     629 </span>                : 
<span class="lineNum">     630 </span>                : #endif // BOOST_TEST_TEST_TOOLS_IPP_012205GER
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
